package com.thoughtworks;

public class CheckoutMovieAction implements Action {
    public void doAction(ActionParams actionParams)
    {
        actionParams.output.displayMessage("Enter the name of the movie");
        String name=actionParams.input.getString();
        boolean result=actionParams.library.checkOutMovie(actionParams.libraryNumber,name);
        String message;
        if(result)
            message="Thank you! Enjoy the movie";
        else
            message="That movie is not available.";
        actionParams.output.displayMessage(message);
    }
}
